
const {ccclass, property} = cc._decorator;

@ccclass
export default class qxc_grid {
    static getNearGridIndexs(rowNum,colNum,gridIndex):number[]{
        let indexs:number[] = [];
        if(gridIndex - rowNum >= 0){
            indexs.push(gridIndex);
        }
        if(gridIndex - 1 >= 0 && (gridIndex-1) % rowNum < (rowNum-1)){
            indexs.push(gridIndex);
        }
        if(gridIndex + rowNum < rowNum*colNum){
            indexs.push(gridIndex);
        }
        if(gridIndex + 1 < rowNum*colNum  && (gridIndex+1) % rowNum > 0){
            indexs.push(gridIndex);
        }
        return indexs;
    } 
}